package club.yuit.rmq;

import org.apache.rocketmq.client.apis.ClientConfiguration;
import org.apache.rocketmq.client.apis.SessionCredentials;
import org.apache.rocketmq.client.apis.SessionCredentialsProvider;
import org.apache.rocketmq.client.apis.StaticSessionCredentialsProvider;

/**
 * @author: yuit
 * @date: 2023/12/12 13:33
 */
public class ClientConfig {

    public static ClientConfiguration clientConfiguration(
            String accessKey,
            String secretKey,
            String endpoints
    ){
        return   ClientConfiguration.newBuilder()
                .setEndpoints(endpoints)
                .setCredentialProvider(
                        new StaticSessionCredentialsProvider(
                                accessKey,secretKey
                        )
                )
                .build();
    }

}
